package com.lening.provider.controller.sms;

import com.lening.provider.service.impl.smsImpl.SendSmsoto;
import com.lening.provider.service.sms.SmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 刘政华
 * @datetime 2024/6/15 09:07
 * @description 类对象
 */
@Slf4j
@RestController
@RequestMapping("sms")
public class SmsController {

    @Autowired
    private SmsService smsService ;

    @PostMapping(value = "sendCode/{phone}")
    public ResponseEntity<Void> sendValidateCode(@PathVariable String phone) {
//            smsService.sendValidateCode(phone);
            SendSmsoto.sendSms(phone);
            return new ResponseEntity<>(HttpStatus.OK); // 返回200 OK状态码
    }

}
